<!DOCTYPE html>
<html lang="en">
<head th:replace="_fragment::head(~{::title})">
    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css">
    <title>标签</title>
</head>
<body>
<!--    导航-->
    <nav th:replace="_fragment::menu(3)" class="ui inverted attached segment m-padded-tb-mini">
        <div class="ui container">
            <div class="ui inverted secondary menu">
                <h2 class="ui teal header item">大鱼</h2>
                <a href="#" class="item"><i class=" home icon"></i>首页</a>
                <a href="#" class="item"><i class=" idea icon"></i>分类</a>
                <a href="#" class="active item"><i class=" tags icon"></i>标签</a>
                <a href="#" class="item"><i class=" clone icon"></i>归档</a>
                <a href="#" class="item"><i class=" info icon"></i>关于我</a>
                <div class="right item">
                    <div class="ui icon inverted transparent input">
                        <input type="text" placeholder="Search....">
                        <i class="search link icon"></i>
                    </div>
                </div>
            </div>
        </div>

    </nav>
<!--中间内容-->
    <div class="m-padded-tb-large" style="max-width: 60em;margin: auto;">
        <div class="ui container">
            <div class="ui attached segment">
                <div class="ui middle two column grid">
                    <div class="column">
                        <h3 class="ui teal header">标签</h3>
                    </div>
                    <div class="right aligned column">
                        共 <h3 class="ui orange header" style="display: inline-block" th:text="${countTag}">10</h3>  个
                    </div>
                </div>

            </div>
            <div class="ui attached segment m-padded-tb-large">
                <div class="ui basic segment" >
                    <span th:each="tag:${tags}">
                        <input type="hidden" name="tag" th:value="${tag.getId()}">
                        <a th:href="@{/toTag(tagid=${tag.getId()})}"  th:class="${blogs.getList().get(0).getTag()==tag.getName() ? 'ui teal basic left pointing label' :'ui basic left pointing label'}" th:classappend="${tag.getCount()==0?'m-a-none':''}" target="_blank" class="ui teal basic left pointing label" style="margin-top: 0.3em;margin-bottom: 0.3em;">
                            <span th:text="${tag.getName()}">Java</span><div class="detail" th:text="${tag.getCount()}">23</div>
                        </a>
                    </span>
                </div>
            </div>
<!--            内容-->
            <div id="tag-container">
                <div th:fragment="typeslimit" class="ui teal segment">
                    <div class="ui padded vertical segment" th:each="blog:${blogs.getList()}" th:if="${blog.getPublished()==2}">
                        <div class="ui grid">
                            <div class="eleven wide column">
                                <input type="hidden" name="blogid" th:value="${blog.getId()}">
                                <h3 class="ui header" th:text="${blog.getTitle()}">你真的理解财富自由吗？</h3>
                                <p th:text="${#strings.abbreviate(blog.getContent(),100)}">1111111111111111111111111111111111111111</p>
                                <div class="ui grid">
                                    <div class="eleven wide column">
                                        <div class="ui horizontal link list">
                                            <div class="item">
                                                <img th:src="@{/images/1.jpg}" src="https://unsplash.it/100/100?image=1005" class="ui avatar image">
                                                <div class="content"><a href="#" class="header">张大鱼</a></div>
                                            </div>
                                            <div class="item">
                                                <i class="calender icon"></i><span th:text="${#dates.format(blog.getUpdateTime(),'yyyy-MM-dd')}">2022-8-7</span>
                                            </div>
                                            <div class="item">
                                                <i class="eye icon"></i><span th:text="${blog.getViews()}">223</span>
                                            </div>
                                        </div>

                                    </div>
                                    <div class="right aligned five wide column">
                                        <a href="#" target="_blank" class="ui teal basic label m-padded-tb-tiny" th:text="${blog.getType()}">认知升级</a>
                                    </div>
                                </div>
                            </div>
                            <div class="five wide column">
                                <a href="#" target="_blank">
                                    <img th:src="${blog.getFirstPicture()}" src="https://unsplash.it/800/450?image=1005" class="ui rounded image">
                                </a>
                            </div>
                        </div>
                    </div>
                    <!--                    footer-->
                    <div class="ui bottom basic segment">
                        <div class="ui middle aligned two column grid">
                            <div class="column">
                                <a th:href="'javascript:page('+${blogs.getPageNum()+1}+')'" th:class="${blogs.getPageNum()==blogs.getPages() ? 'ui mini teal basic disabled button':'ui mini teal basic button'}" class="ui mini teal basic button">下一页</a>
                            </div>
                            <div class="right aligned column">
                                <a th:href="'javascript:page('+${blogs.getPageNum()-1}+')'" th:class="${blogs.getPageNum()==1 ? 'ui mini teal basic disabled button':'ui mini teal basic button'}" class="ui mini teal basic button">上一页</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
<!--底部footer-->
    <footer th:replace="_fragment::footer" class="ui inverted vertical segment m-padded-tb-massive">
        <div class="ui center aligned container">
            <div class="ui inverted divided grid">
                <div class="three wide column">
                    <div class="ui inverted link list">
                        <div class="item">
                            <img src="../images/1.jpg" class="ui rounded image" style="width: 110px">
                        </div>
                    </div>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header">最新博客</h4>
                    <div class="ui inverted link list">
                        <a href="#" class="item">故事</a>
                        <a href="#" class="item">故事</a>
                        <a href="#" class="item">故事</a>
                    </div>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header">联系我</h4>
                    <div class="ui inverted link list">
                        <a href="#" class="item">Emile:748835228@qq.com</a>
                        <a href="#" class="item">QQ: 748835228</a>
                    </div>
                </div>
                <div class="seven wide column">
                    <h4 class="ui inverted header">最新博客</h4>
                    <p>111111111111111111111111111111</p>
                </div>
            </div>
            <div class="ui inverted section divider"></div>

        </div>
    </footer>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
<script>
    function page(pageNum){
        let tagid;
        if ($("[name='type']").val() > 0) {
            tagid = $("[name='tag']").val();
        } else {
            tagid = 0;
        }
        $("#tag-container").load("/TagSearch", {
            "tagid": tagid,
            "num": pageNum,
        });
    };
</script>



</body>
</html>